<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="org.springside.modules.security.domain.PortletChartDefinition" table="portlet_chart_definition"
     dynamic-insert="true" dynamic-update="true">
      <id name="id" type="integer">
            <column name="id" />
            <generator class="native" >
				<param name="sequence">PORTLET_CHART_DEF_ID_SEQ</param>
            </generator>
        </id>
        <property name="chartCode" type="string">
        	<!-- 图表英文名称 -->
            <column name="chart_code" length="50" />
        </property>
        <property name="chartName" type="string">
        	<!-- 图表中文名 -->
            <column name="chart_name" length="50" />
        </property>
        <property name="chartCategory" type="string">
        	<!-- 图表分类Charts，Widgets，保留字段 -->
            <column name="chart_category" length="25" />
        </property>
        <property name="status" type="integer">
        	<!-- 是否有效，0无效，1有效，初始未保存的portlet tab，默认不生效 -->
        	<column name="status" default="0" />
        </property>
        <property name="cacheLevel" type="string">
        	<!-- 缓存级别，n无缓存，u用户个人级，d部门级，p页签级，s系统级 -->
            <column name="cache_level" length="1" />
        </property>
        <property name="cacheLive" type="integer">
        	<!-- 缓存元素活的时间周期，0表示不过期 -->
            <column name="cache_live" default="0" />
        </property>
        <property name="cacheIdle" type="integer">
        	<!-- 缓存元素状态，0表示未激活 -->
            <column name="cache_idle" default="0" />
        </property>
        <property name="xml" type="text">
        	<!-- 图表配置文件 -->
        	<column name="xml"/>
        </property>
        <property name="dictsOption" type="string">
        	<!-- 图表配置文件包含着sql语句 -->
        	<column name="dicts_option"/>
        </property>
        <property name="depts" type="string">
        	<!-- 授权使用部门范围，上级包含下级，多个部门使用,号分隔 -->
            <column name="depts" length="200" />
        </property>
        <property name="users" type="string">
        	<!-- 授权使用用户范围，使用,号分隔 -->
            <column name="users" length="200" />
        </property>
        <property name="descn" type="string">
        	<!-- 描述，预留 -->
            <column name="descn" length="200" />
        </property>
        <many-to-one name="portletChartType" class="org.springside.modules.security.domain.PortletChartType" fetch="select">   
         <column name="chartType_id" />
        </many-to-one>
    </class>
</hibernate-mapping>
